<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算学生成绩案例</title>
    <script>
        var one = prompt('请输入班级总人数')
        var num = 0
        var three = 0
        for (var i = 1; i <= one; i++ ) {
            var two = prompt('请输入第' + i + '个学生的成绩' )
            num += parseFloat(two)
        }
        three = num / one
        alert('班级平均分为' + three)
    </script>
</head>
<body>
    
</body>
</html>